package sinosoftsh.provider.app.web;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xujingfeng on 2017/8/3.
 */
@RestController
@RequestMapping("/api")
public class CalculateController{

    @PostMapping("/hehehe")
    public Integer hehehe(Integer a, Integer b){
        //throw new RuntimeException();
        return a+b;
    }

   @PostMapping("/add")
    public Integer add(Integer a, Integer b){
        throw new RuntimeException();
        //return a+b;
    }

   @PostMapping("/subtract")
    public Integer subtract(Integer a, Integer b){
        return a-b;
    }

}
